<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('online_users', function (Blueprint $table) {
            $table->unsignedInteger('online_duration')->default(0)->after('last_activity_at')->comment('在线时长（秒）');
        });
    }

    public function down(): void
    {
        Schema::table('online_users', function (Blueprint $table) {
            $table->dropColumn('online_duration');
        });
    }
};

